/**
 * Licensed by the Bunie Developmentgroup.
 */
package Protocol;

/**
 * @author Wouter Class to responde to an inlogrequestpacket
 */
public class InlogResponsePacket extends BasicPacket {

    private int typeOfClient;
    public int inlogStatus = 0;
    public final static int INLOGSUCCES = 1;
    public final static int INLOGFAILED = -1;
    public final static int INCORRECTPASS = -2;

    /**
     * Constructor for the inlogrequestpacket
     *
     * @param version Version of this inlogresponsepacket
     */
    public InlogResponsePacket(int version) {
        super(version);
        this.type = PacketTypeKeeper.INLOGRESPONSEPACKET;
    }

     /**
     * Methode to set the status of the login that this is a response to
     * @param inlogStatus to set if the inlog was a succes or a failure
     */
    public void setInlogStatus(int inlogStatus) {
        this.inlogStatus = inlogStatus;
    }

    /**
     * Methode to get the status of login that this is a response to
     *
     * @return Inlogstatus value
     */
    public int getInlogStatus() {
        return this.inlogStatus;
    }

    /**
     * Methode to get the type of client that send the inlogrequestpacket
     *
     * @return Type of client
     */
    public int getTypeOfClient() {
        return this.typeOfClient;
    }

    /**
     * methode to set the type of client that send this inlogrequestpacket
     *
     * @param typeOfClient Type of client that send this inlogrequestpacket
     */
    public void setTypeOfClient(int typeOfClient) {
        this.typeOfClient = typeOfClient;
    }

    @Override
    public int getType() {
        return this.type;
    }
    //oude method ivm fix
    @Override
    public String toString() {
        return super.toString()+ " "
               + "Status "     +inlogStatus + " "
               + "ClientType " +typeOfClient; //PacketTypeKeeper.translate(typeOfClient);
    }
}